<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>3-8</title>
 <!--   引入jQuery -->
 <script src="../../scripts/jquery.js" type="text/javascript"></script>
 <script type="text/javascript">
 //<![CDATA[
  $(function(){
      //设置<p>元素的属性'title'
      $("input:eq(0)").click(function(){
			$("p").attr("title","选择你最喜欢的水果.");
	  });
      //获取<p>元素的属性'title'
	  $("input:eq(1)").click(function(){
			alert( $("p").attr("title") );
	  });
      //删除<p>元素的属性'title'
	  $("input:eq(2)").click(function(){
			$("p").removeAttr("title");
	  });   

  });
  //]]>
  </script>
</head>
<body>
    <input type="button" value="设置<p>元素的属性'title'"/>
	<input type="button" value="获取<p>元素的属性'title'"/>
	<input type="button" value="删除<p>元素的属性'title'"/>


	<p title="选择你最喜欢的水果." >你最喜欢的水果是?</p>
	<ul>
	  <li title='苹果'>苹果</li>
	  <li title='橘子'>橘子</li>
	  <li title='菠萝'>菠萝</li>
	</ul>
</body>
</html>

 